package com.csf.create.singleton;

/**
 * 单例模式：
 *
 * 保证线程安全
 * 提高性能
 *
 * Date: 2018/9/6
 * Time: 12:34
 *
 * @author chenshf
 */
public class Test {

    public static void main(String[] args) {
        for (int i = 0; i < 100; i++) {

            new Thread(() -> {
                SingleTon singleTon = SingleTon.getInstance();
                System.out.println(Thread.currentThread().getName() + singleTon.toString());
            }).start();
        }

    }
}
